<!doctype html>

<%@LANGUAGE="JScript" %>
<!--#include file ="Includes/JSON2.asp"-->
<!--#include file ="Includes/User.asp"-->
<!--#include file ="Includes/ASPHelpers.asp"-->

<%/*--- BEGIN ASP ------------------------------------------------------------------------------------*/

	var nowDate = new Date();
	var nowString = nowDate.getDate() + "/" + (nowDate.getMonth() + 1) + "/" + nowDate.getFullYear();
    
    
    

/*--- /END ASP -----------------------------------------------------------------------------------------*/%>

<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dispatch Report</title>
<link href="UniversalStyleSheet.css" rel="stylesheet" type="text/css" />
<style type="text/css">
a
{
	text-decoration:underline;
	color:#0000CC;
}

body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style9 {color: #000000}
</style>

<!--calendar scripts -->
<script language="JavaScript" src="JavaSupportFiles/CalendarPopup.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">document.write(getCalendarStyles());</script>

<script language="JavaScript" id="jscal1x" type="text/javascript">
	var cal1xx = new CalendarPopup("CalendarDiv");
	cal1xx.showYearNavigation();
	cal1xx.showYearNavigationInput();
	cal1xx.setWeekStartDay(1);
</script>

<script type="text/javascript">
			
	function applyfilter(){
		ff=document.getElementById("FilterField")
		filterfieldval=ff.options[ff.selectedIndex].value
		filtertypeval=ff.options[ff.selectedIndex].datatype //datatype is xhtml user-defined property in the <option> tag
		filtercriteriaval=document.getElementById("filtercriteria").value
		fromval=document.getElementById("from").value
		toval=document.getElementById("to").value
		document.getElementById("DataFrame").src="dispatchreportdata.asp?filterfield="+filterfieldval+"&from="+fromval+"&to="+toval+"&filtercriteria=" + filtercriteriaval + "&filtertype=" + filtertypeval + "?r=" + Math.floor(Math.random(1000000))
	}

	function sortby(what){
		document.getElementById("sort").value=what
		applyfilter()
	}

	function city_change(){
		document.FilterForm.zip.value=""
	}

	function zip_change(){
		document.FilterForm.city.selectedIndex=-1
	}
</script>

</head>

<body>
<form id="FilterForm" name="FilterForm" method="post" action="javascript: applyfilter()" onsubmit="javascript: applyfilter()">

	<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="1" align="right"><span class="SearchFormText">
			<span class="style9">
				Filter: Column
			</span>
			<select  name="FilterField" id="FilterField" title="Use This List To Choose A Field In Which To Filter The Tickets Shown For Your Selected Date Range. This List Of Fields (Or 'Columns') Is Used In Conjunction With The Criteria Field To The Right (I.E. Choosing 'Address' From This List And Then Typing Something Into The 'Criteria' Box To The Right And Clicking 'Apply' Will Cause The List Of Tickets Below To Be Filtered For Only Those Tickets Whose 'Address' Contains Whatever Critieria You Typed Into The Criteria Box To The Right">
				<option value=" " selected="selected"></option>
				<option value="Ticket_ID" datatype="numeric">Ticket #</option>
				<option value="Contract_ID" datatype="string">Contract #</option>
				<option value="zip" datatype="numeric">ZipCode</option>
				<option value="address" datatype="string">Address</option>
				<option value="appliance" datatype="string">Appliance</option>
				<option value="emergency" datatype="string">Emergency</option>
				<option value="created_time" datatype="date">Created Date</option>
				<option value="completed_time" datatype="date">Completed Date</option>
				<option value="status" datatype="string">Status</option>
				<option value="follow_up" datatype="string">Follow Up</option>
				<option value="custname" datatype="string">Name</option>
				<option value="city" datatype="string">City</option>
			</select> 
			Criteria 
			<input name="filtercriteria" type="text" id="filtercriteria" title="Type Here To Define The 'Criteria' That You Are Looking For Within The Chosen 'Column' To The Left In Which To Filter The Tickets In Your Chosen Date Range (I.E. Typing Here 'ABC123' And Clicking Apply Will Cause The List Of Tickets Below To Be Filtered For Only Those Tickets That Contain 'ABC123' Within The Chosen Field From The List On The Right" size="35" />
			<span class="SearchFormText">
				From <a href="#" onclick="cal1xx.select(document.forms['FilterForm'].from,'fromlink','MM/dd/yyyy'); return false;" title="Click To Open Calendar To Choose The 'From' Date" name="fromlink" id="fromlink">
						<img src="Images/calendar.jpg" alt="FromDate" title="Click Here To Choose 'From' Date" border="0"/>
					</a>
			</span>
			
            <input name="from" type="text" id="from" size="10" value="<%= nowString %>"/>
            
            <span class="SearchFormText"> 
				To <a href="#" onclick="cal1xx.select(document.forms['FilterForm'].to,'tolink','MM/dd/yyyy'); return false;" title="Click To Open Calendar To Choose The 'To' Date" name="tolink" id="tolink"><img src="Images/calendar.jpg" alt="ToDate" title="Click Here To Choose 'To' Date" border="0"/></a>
			</span>
            <input name="to" type="text" id="to" size="10" value="<%= nowString %>"/>
			<a href="javascript: applyfilter()">
				<img src="Images/ApplyButton.png" alt="Click 'Apply' To Retrieve A List Of Tickets That Match The Various Filtering Criteria That You Have Entered In The Fields On This Line" width="50" height="25" border="0" align="absbottom" />
			</a>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
      </tr>
  </table>
	

	<table width="980" border="0" cellspacing="0" cellpadding="0">

	  <tr>
		<td width="20" height="20" background="Images/TableUpperLeft.png"></td>
		<td width="940" height="20" background="Images/TableUpperMiddle.png"></td>
		<td width="20" height="20" background="Images/TableUpperRight.png"></td>
	  </tr>
	  <tr>
		<td width="20" background="Images/TableMiddleLeft.png"></td>
		<td width="860" bgcolor="#FFFFFF">
		<table width="890" cellpadding="0" cellspacing="1" bgcolor="#009900">
		 <tr>
			<td ><iframe src="DispatchReportData.asp" width="927" height="200" frameborder="0" scrolling="auto" id="DataFrame" name="DataFrame"> </iframe></td>
		  </tr>
		</table>
		</td>
		<td width="20" background="Images/TableMiddleRight.png"></td>
	  </tr>
	  <tr>
		<td width="20" height="20" background="Images/TableLowerLeft.png"></td>
		<td width="940" height="20" background="Images/TableLowerMiddle.png"></td>
		<td width="20" height="20" background="Images/TableLowerRight.png"></td>
	  </tr>
	</table>
</form>

<DIV ID="CalendarDiv" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>

</body>
</html>
